#ifndef __BROKER_H_
#define __BROKER_H_

#include "_Subscriber.h"
#include <pthread.h>
#include <map>
#include <vector>
#include <string>

using namespace std;

namespace skelepp {
	namespace Core {
		namespace Messaging {
			class Broker {
			private:
				map<string, vector<_Subscriber *>> _subscribers;
				pthread_mutex_t _lock;
			public:
				Broker();
				~Broker();
				
				void subscribe(string, _Subscriber *subscriber);
				void unsubscribe(string, _Subscriber *subscriber);
				void push(_Message *message);
			};
		}
	}
}

#endif